class CreateCommunities < ActiveRecord::Migration
  def self.up
    create_table :communities do |t|
			t.string :title, :null=>false
			t.string :slug
			t.string :subject
			t.string :site
			t.integer :city_id
			t.integer :country_id, :null=>false
			t.string :description
			t.string :notes
			t.integer :user_id
			t.integer :posts_count, :default=>0
			t.string :cached_tag_list
      t.timestamps
    end
    
    add_index :communities, [:user_id], :name=>"fk_user"
    add_index :communities, [:country_id], :name=>"fk_country"
  end

  def self.down
    drop_table :communities
  end
end
